package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;

import com.ruoyi.system.mapper.api.MUserMachineDetailMapper;
import com.ruoyi.system.domain.api.MUserMachineDetail;
import com.ruoyi.system.service.IMUserMachineDetailService;

/**
 * 用户矿机收益Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-22
 */
@DataSource(DataSourceType.SLAVE)
@Service
public class MUserMachineDetailServiceImpl implements IMUserMachineDetailService 
{
    @Autowired
    private MUserMachineDetailMapper mUserMachineDetailMapper;

    /**
     * 查询用户矿机收益
     * 
     * @param id 用户矿机收益主键
     * @return 用户矿机收益
     */
    @Override
    public MUserMachineDetail selectMUserMachineDetailById(Long id)
    {
        return mUserMachineDetailMapper.selectMUserMachineDetailById(id);
    }

    /**
     * 查询用户矿机收益列表
     * 
     * @param mUserMachineDetail 用户矿机收益
     * @return 用户矿机收益
     */
    @Override
    public List<MUserMachineDetail> selectMUserMachineDetailList(MUserMachineDetail mUserMachineDetail)
    {
        return mUserMachineDetailMapper.selectMUserMachineDetailList(mUserMachineDetail);
    }

    /**
     * 新增用户矿机收益
     * 
     * @param mUserMachineDetail 用户矿机收益
     * @return 结果
     */
    @Override
    public int insertMUserMachineDetail(MUserMachineDetail mUserMachineDetail)
    {
        mUserMachineDetail.setCreateTime(DateUtils.getNowDate());
        return mUserMachineDetailMapper.insertMUserMachineDetail(mUserMachineDetail);
    }

    /**
     * 修改用户矿机收益
     * 
     * @param mUserMachineDetail 用户矿机收益
     * @return 结果
     */
    @Override
    public int updateMUserMachineDetail(MUserMachineDetail mUserMachineDetail)
    {
        return mUserMachineDetailMapper.updateMUserMachineDetail(mUserMachineDetail);
    }

    /**
     * 批量删除用户矿机收益
     * 
     * @param ids 需要删除的用户矿机收益主键
     * @return 结果
     */
    @Override
    public int deleteMUserMachineDetailByIds(Long[] ids)
    {
        return mUserMachineDetailMapper.deleteMUserMachineDetailByIds(ids);
    }

    /**
     * 删除用户矿机收益信息
     * 
     * @param id 用户矿机收益主键
     * @return 结果
     */
    @Override
    public int deleteMUserMachineDetailById(Long id)
    {
        return mUserMachineDetailMapper.deleteMUserMachineDetailById(id);
    }
}
